<template>
	<!-- 管理 -->
	<view class="orgmanager-container">
		<view class="btns">
			<navigator class="activity" url="/pages/Activity_apply/Activity_apply">活动申请</navigator>
			<navigator class="post" url="">帖子申请</navigator>
		</view>

		<view class="content">
			<view class="title">加入组织申请</view>
			<view class="wrap" v-if="memberList.length>0">
				<view class="item" v-for="item in memberList" :key="item.id">
					<!-- 头像 -->
					<view class="item-l">
						<image :src="item.img"></image>
					</view>
					<view class="item-r">
						<!-- 姓名 -->
						<view class="item-r-name">{{item.name}}1</view>
						<!-- 详情 -->
						<view class="item-r-info">
							<view class="item-r-info-date">{{item.school_time}}1</view>
							<view class="item-r-info-major">{{item.major}}1</view>
						</view>
					</view>

					<view class="yes">
						<image src="/static/Organization/yes.png" mode="widthFix"></image>
					</view>
					<view class="no">
						<image src="/static/Organization/no.png" mode="widthFix"></image>
					</view>
				</view>
			</view>
			<view class="noimg" v-else>
				<image src="/static/Organization/noimg.png" mode="widthFix"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				// 成员列表
				memberList: []
			}
		},
		methods: {
			/**
			 * 获取组织成员列表
			 */
			getMemberList() {
				this.$request.post({
					url: '/api/organization/members',
					data: {
						organization_id: 1, //this.id,
						is_all: true
					},
					success: res => {
						if (res.code != 200) return uni.showToast({
							title: res.msg,
							icon: 'none'
						})
						this.memberList = res.result
					}
				})
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getMemberList()
		}
	}
</script>

<style lang="less" scoped>
	.orgmanager-container {
		width: 100%;
		min-height: 100vh;
		background-color: #fff;
		padding: 20rpx;
		box-sizing: border-box;

		.btns {
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.activity {
				width: 346rpx;
				height: 140rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.1);
				opacity: 1;
				font-size: 28rpx;
				font-family: Source Han Sans CN-Regular, Source Han Sans CN;
				font-weight: 400;
				color: #333333;
				line-height: 28rpx;
				letter-spacing: 1px;
				display: flex;
				justify-content: center;
				align-items: center;
			}

			.post {
				width: 346rpx;
				height: 140rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.1);
				opacity: 1;
				font-size: 28rpx;
				font-family: Source Han Sans CN-Regular, Source Han Sans CN;
				font-weight: 400;
				color: #333333;
				line-height: 28rpx;
				letter-spacing: 1px;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}

		>.content {
			width: 100%;
			padding: 0 20rpx;
			box-sizing: border-box;
			overflow: hidden;

			>.title {
				font-size: 28rpx;
				font-family: Source Han Sans CN-Medium, Source Han Sans CN;
				font-weight: 500;
				color: #333333;
				line-height: 28rpx;
				letter-spacing: 1px;
				margin-top: 40rpx;
			}

			>.noimg {
				width: 434rpx;
				height: 428rpx;
				margin: 296rpx auto 0;

				>image {
					width: 100%;
				}
			}

			>.wrap {
				width: 100%;

				.item {
					width: 100%;
					padding: 20rpx 0;
					box-sizing: border-box;
					display: flex;
					align-items: center;
					border-bottom: 2rpx solid #f1f1f1;
					position: relative;

					>.yes {
						width: 120rpx;
						height: 60rpx;
						border-radius: 999rpx;
						overflow: hidden;
						position: absolute;
						right: 0;
						top: 50%;
						transform: translateY(-50%);

						>image {
							width: 100%;
						}
					}

					>.no {
						width: 120rpx;
						height: 60rpx;
						border-radius: 999rpx;
						overflow: hidden;
						position: absolute;
						right: 140rpx;
						top: 50%;
						transform: translateY(-50%);

						>image {
							width: 100%;
						}
					}

					&-l {
						width: 92rpx;
						height: 92rpx;
						border-radius: 50%;
						overflow: hidden;

						>image {
							width: 100%;
						}
					}

					&-r {
						flex: 1;
						height: 92rpx;
						display: flex;
						flex-direction: column;
						justify-content: space-around;
						margin-left: 20rpx;

						&-name {
							font-size: 28rpx;
							font-family: Source Han Sans CN-Medium, Source Han Sans CN;
							font-weight: 500;
							color: #333333;
							line-height: 28rpx;
						}

						&-info {
							display: flex;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #666666;
							line-height: 34rpx;
							letter-spacing: 1px;

							&-date {
								margin-right: 20rpx;
							}
						}
					}
				}
			}
		}
	}
</style>